home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-01-30 | 36.1 KB | 1,351 lines |
- diff -w -c org/analyze.c src/analyze.c
- *** org/analyze.c Wed Jun 15 15:50:23 1994
- --- src/analyze.c Tue Jan 17 08:14:20 1995
- ***************
- *** 465,470 ****
- --- 465,475 ----
- if (csp->voidf || (csp->exp->nodetype == en_icon &&
- csp->exp->v.i < 16 && csp->exp->v.i >= 0))
- return 0;
- + #ifdef TRAP_GEN
- + if (trap_option && csp->exp->nodetype == en_nacon &&
- + !strncmp(csp->exp->v.sp, "_trap_1", (size_t)7))
- + return 0;
- + #endif /* TRAP_GEN */
- if (is_lvalue(csp->exp))
- return 2 * csp->uses;
- return csp->uses;
- ***************
- *** 478,488 ****
- CSE **lst;
- {
- CSE *csp1, *csp2;
- csp1 = *lst;
- if (csp1 == 0 || csp1->next == 0)
- return;
- bsort(&(csp1->next));
- ! while (csp1 != 0 && (csp2 = csp1->next) != 0 && desire(csp1) < desire(csp2)) {
- *lst = csp2;
- csp1->next = csp2->next;
- csp2->next = csp1;
- --- 483,495 ----
- CSE **lst;
- {
- CSE *csp1, *csp2;
- + register int d1;
- csp1 = *lst;
- if (csp1 == 0 || csp1->next == 0)
- return;
- bsort(&(csp1->next));
- ! d1 = desire(csp1);
- ! while (csp1 != 0 && (csp2 = csp1->next) != 0 && d1 < desire(csp2)) {
- *lst = csp2;
- csp1->next = csp2->next;
- csp2->next = csp1;
- diff -w -c org/cglbdec.h src/cglbdec.h
- *** org/cglbdec.h Wed Jun 15 15:50:23 1994
- --- src/cglbdec.h Tue Jan 17 08:11:16 1995
- ***************
- *** 97,102 ****
- --- 97,105 ----
- #ifdef TRACE
- extern BOOL trace_option; /* generate trace code */
- #endif /* TRACE */
- + #ifdef TRAP_GEN
- + extern BOOL trap_option; /* generate traps for gemdos, xbios and bios */
- + #endif /* TRAP_GEN */
- extern int max_error_count; /* maximum number of errors before stopping */
-
- extern TYP *ret_type;
- ***************
- *** 147,152 ****
- --- 150,158 ----
- #ifdef TARGET_ACK
- extern struct funcs ack68k_funcs;
- #endif /* TARGET_ACK */
- + #ifdef TARGET_JAS
- + extern struct funcs jas68k_funcs;
- + #endif /* TARGET_JAS */
- #ifdef TARGET_GAS
- extern struct funcs gas68k_funcs;
- #endif /* TARGET_GAS */
- diff -w -c org/cglbdef.c src/cglbdef.c
- *** org/cglbdef.c Wed Jun 15 15:50:23 1994
- --- src/cglbdef.c Tue Jan 17 08:10:38 1995
- ***************
- *** 116,122 ****
- #endif /* FORMAT_OPTION */
- #ifdef TRACE
- BOOL trace_option = 0;
- ! #endif
- #ifdef PROBES
- BOOL probe_option = 0;
- #endif /* PROBES */
- --- 116,125 ----
- #endif /* FORMAT_OPTION */
- #ifdef TRACE
- BOOL trace_option = 0;
- ! #endif /* TRACE */
- ! #ifdef TRAP_GEN
- ! BOOL trap_option = 0;
- ! #endif /* TRAP_GEN */
- #ifdef PROBES
- BOOL probe_option = 0;
- #endif /* PROBES */
- ***************
- *** 203,208 ****
- --- 206,214 ----
- #ifdef TARGET_ACK
- struct funcs *Funcs = &ack68k_funcs;
- #else
- + #ifdef TARGET_JAS
- + struct funcs *Funcs = &jas68k_funcs;
- + #else
- #ifdef TARGET_GAS
- struct funcs *Funcs = &gas68k_funcs;
- #else
- ***************
- *** 214,219 ****
- --- 220,226 ----
- #endif /* TARGET_QMAC */
- #endif /* TARGET_CPM */
- #endif /* TARGET_GAS */
- + #endif /* TARGET_JAS */
- #endif /* TARGET_ACK */
- #endif /* MC680X0 */
-
- diff -w -c org/chdr.h src/chdr.h
- *** org/chdr.h Wed Jun 15 15:50:31 1994
- --- src/chdr.h Tue Jan 17 08:04:44 1995
- ***************
- *** 570,576 ****
- #define WARN_LEVEL2 WARN_AUTOINIT
- WARN_AUTOINIT,
- WARN_NOHEX,
- - WARN_PARAMSIZE,
- WARN_REDEFINE,
- WARN_SIZEOF0,
- WARN_SIZEOFBIG,
- --- 570,575 ----
- ***************
- *** 606,611 ****
- --- 605,611 ----
- WARN_IMPLICIT,
- WARN_NOTKANDR,
- WARN_NOTREACHED,
- + WARN_PARAMSIZE,
- WARN_PROTOTYPE,
- WARN_PROMOTE,
- WARN_STORAGE,
- diff -w -c org/check.h src/check.h
- *** org/check.h Wed Jun 15 15:50:23 1994
- --- src/check.h Tue Jan 17 08:04:50 1995
- ***************
- *** 125,137 ****
- --- 125,164 ----
- #ifdef TARGET_GAS
- #define MULTIPLE_ASSEMBLERS
- #endif /* TARGET_GAS */
- + #ifdef TARGET_QMAC
- + #define MULTIPLE_ASSEMBLERS
- + #endif /* TARGET_QMAC */
- + #ifdef TARGET_JAS
- + #define MULTIPLE_ASSEMBLERS
- + #endif /* TARGET_JAS */
- #endif /* TARGET_ACK */
-
- #ifdef TARGET_CPM
- #ifdef TARGET_GAS
- #define MULTIPLE_ASSEMBLERS
- #endif /* TARGET_GAS */
- + #ifdef TARGET_QMAC
- + #define MULTIPLE_ASSEMBLERS
- + #endif /* TARGET_QMAC */
- + #ifdef TARGET_JAS
- + #define MULTIPLE_ASSEMBLERS
- + #endif /* TARGET_JAS */
- #endif /* TARGET_CPM */
- +
- + #ifdef TARGET_GAS
- + #ifdef TARGET_QMAC
- + #define MULTIPLE_ASSEMBLERS
- + #endif /* TARGET_QMAC */
- + #ifdef TARGET_JAS
- + #define MULTIPLE_ASSEMBLERS
- + #endif /* TARGET_JAS */
- + #endif /* TARGET_GAS */
- +
- + #ifdef TARGET_QMAC
- + #ifdef TARGET_JAS
- + #define MULTIPLE_ASSEMBLERS
- + #endif /* TARGET_JAS */
- + #endif /* TARGET_QMAC */
- #endif /* MC680X0 */
-
- #ifdef INTEL_386
- ***************
- *** 191,193 ****
- --- 218,232 ----
- #endif /* TARGET_SYSV */
- #endif /* TARGET_SUN */
- #endif /* INTEL_8086 */
- +
- + #ifdef TRAP_GEN
- + #if !defined(MC680X0) || !defined(__TOS__)
- + error, cannot do trap generation
- + #endif
- + #endif /* TRAP_GEN */
- +
- + #ifdef JAS_PATCH
- + #if !defined(TARGET_JAS) || defined(MULTIPLE_ASSEMBLERS) || defined(RELOC_BUG)
- + error, cannot use jas patch
- + #endif
- + #endif /* JAS_PATCH */
- diff -w -c org/cmain.c src/cmain.c
- *** org/cmain.c Wed Jun 15 15:50:24 1994
- --- src/cmain.c Tue Jan 17 08:09:54 1995
- ***************
- *** 41,46 ****
- --- 41,50 ----
-
- #undef P_
-
- + #ifdef __MINT__
- + long _stksize = 32768L;
- + #endif
- +
- static void
- exception(sig)
- int sig;
- ***************
- *** 212,219 ****
- #endif /* PROBES */
- {"reg", invert, ®_option, NULL},
- {"revbit", invert, &bitfield_option, NULL},
- - {"short", invert, &short_option, NULL},
- {"separate", invert, &IandD_option, NULL},
- #ifdef STACK_CHECK
- {"stackcheck", invert, &stackcheck_option, NULL},
- #endif /* STACK_CHECK */
- --- 216,223 ----
- #endif /* PROBES */
- {"reg", invert, ®_option, NULL},
- {"revbit", invert, &bitfield_option, NULL},
- {"separate", invert, &IandD_option, NULL},
- + {"short", invert, &short_option, NULL},
- #ifdef STACK_CHECK
- {"stackcheck", invert, &stackcheck_option, NULL},
- #endif /* STACK_CHECK */
- ***************
- *** 223,228 ****
- --- 227,235 ----
- #endif /* TRACE */
- {"trad", invert, &trad_option, NULL},
- {"trans", invert, &trans_option, NULL},
- + #ifdef TRAP_GEN
- + {"trap", invert, &trap_option, NULL},
- + #endif /* TRAP_GEN */
- {"uchar", invert, &uchar_option, NULL},
- #ifdef MULTIPLE_ASSEMBLERS
- #ifdef INTEL_8086
- ***************
- *** 251,256 ****
- --- 258,266 ----
- #ifdef TARGET_ACK
- {"ack68k", chip, &ack68k_funcs, &mc68k_funcs},
- #endif /* TARGET_ACK */
- + #ifdef TARGET_JAS
- + {"jas68k", chip, &jas68k_funcs, &mc68k_funcs},
- + #endif /* TARGET_JAS */
- #ifdef TARGET_CPM
- {"cpm68k", chip, &cpm68k_funcs, &mc68k_funcs},
- #endif /* TARGET_CPM */
- ***************
- *** 370,383 ****
- argv++;
- if (argc > 1)
- /* used named file instead of stdout */
- ! if ((output = fopen(*argv, "w")) == NULL) {
- message(MSG_OPENFILE,*argv,message_text(MSG_OUTPUT));
- exit(2);
- }
- argv++;
- if (argc > 2)
- /* used named listing file instead of stderr */
- ! if ((listfile = fopen(*argv, "w")) == NULL) {
- message(MSG_OPENFILE,*argv,message_text(MSG_LISTING));
- exit(2);
- }
- --- 380,393 ----
- argv++;
- if (argc > 1)
- /* used named file instead of stdout */
- ! if ((output = fopen(*argv, "wb")) == NULL) {
- message(MSG_OPENFILE,*argv,message_text(MSG_OUTPUT));
- exit(2);
- }
- argv++;
- if (argc > 2)
- /* used named listing file instead of stderr */
- ! if ((listfile = fopen(*argv, "wb")) == NULL) {
- message(MSG_OPENFILE,*argv,message_text(MSG_LISTING));
- exit(2);
- }
- diff -w -c org/config.c68 src/config.c68
- *** org/config.c68 Wed Jun 15 15:50:24 1994
- --- src/config.c68 Tue Jan 17 08:05:02 1995
- ***************
- *** 24,30 ****
- #define HAS_STDARG /* system supports stdarg.h */
- #define FORMAT_CHECK /* Check fprintf and fscanf format strings */
- #undef PROBES /* Support stack probes */
- ! #undef STACK_CHECK /* library routine to check stack size */
- /*
- * These options tend not to be changed except when developing
- */
- --- 24,30 ----
- #define HAS_STDARG /* system supports stdarg.h */
- #define FORMAT_CHECK /* Check fprintf and fscanf format strings */
- #undef PROBES /* Support stack probes */
- ! #define STACK_CHECK /* library routine to check stack size */
- /*
- * These options tend not to be changed except when developing
- */
- ***************
- *** 79,85 ****
- #undef MC68020 /* This is an 68020 compiler */
- #undef MC68030 /* This is an 68030 compiler */
-
- ! #define TARGET_ACK /* Generate ACK assembler output */
- #undef TARGET_CPM /* Generate DRI assembler output */
- #undef TARGET_GAS /* Generate GAS assembler output */
- #undef TARGET_QMAC /* Generate QMAC assembler output */
- --- 79,86 ----
- #undef MC68020 /* This is an 68020 compiler */
- #undef MC68030 /* This is an 68030 compiler */
-
- ! #undef TARGET_ACK /* Generate ACK assembler output */
- ! #define TARGET_JAS /* Generate JAS assembler output */
- #undef TARGET_CPM /* Generate DRI assembler output */
- #undef TARGET_GAS /* Generate GAS assembler output */
- #undef TARGET_QMAC /* Generate QMAC assembler output */
- ***************
- *** 90,98 ****
- * of ACK has this bug fixed, then in some cases slightly more
- * efficient code is generated if you comment out this option
- */
- ! #define MOVEMBUG /* Assembler has problems in MOVEM */
- ! #define CMP_BUG /* Assembler has problems in CMP */
- ! #define RELOC_BUG /* Assembler has problems with Label1-Label2 */
-
- /*
- * INTEL 386 OPTIONS
- --- 91,99 ----
- * of ACK has this bug fixed, then in some cases slightly more
- * efficient code is generated if you comment out this option
- */
- ! #undef MOVEMBUG /* Assembler has problems in MOVEM */
- ! #undef CMP_BUG /* Assembler has problems in CMP */
- ! #undef RELOC_BUG /* Assembler has problems with Label1-Label2 */
-
- /*
- * INTEL 386 OPTIONS
- ***************
- *** 138,144 ****
- * Ensure that the setting is compatible with the value defined in your
- * library and header files.
- */
- ! #define TP_SIZE tp_uint /* size_t type; either tp_uint or tp_ulong */
- /*
- * Many K&R compilers have assumed that the result of the pointer
- * difference operation is an int. However ANSI assumes that the
- --- 139,145 ----
- * Ensure that the setting is compatible with the value defined in your
- * library and header files.
- */
- ! #define TP_SIZE tp_ulong /* size_t type; either tp_uint or tp_ulong */
- /*
- * Many K&R compilers have assumed that the result of the pointer
- * difference operation is an int. However ANSI assumes that the
- ***************
- *** 146,152 ****
- * with the value defined in your library and header files.
- * NOTE: This must be a signed value.
- */
- ! #define TP_PTRDIFF tp_int /* ptrdiff_t type; either tp_int or tp_long */
-
- /*
- * The type of a wide character is implementation defined and has an
- --- 147,153 ----
- * with the value defined in your library and header files.
- * NOTE: This must be a signed value.
- */
- ! #define TP_PTRDIFF tp_long /* ptrdiff_t type; either tp_int or tp_long */
-
- /*
- * The type of a wide character is implementation defined and has an
- diff -w -c org/decl.c src/decl.c
- *** org/decl.c Wed Jun 15 15:50:24 1994
- --- src/decl.c Tue Jan 17 08:05:12 1995
- ***************
- *** 567,574 ****
- TYP *
- type_name()
- {
- ! TYP *tp;
- ! SYM *sp = 0;
- STORAGE sc;
-
- switch (lastst) {
- --- 567,574 ----
- TYP *
- type_name()
- {
- ! TYP *tp = 0;
- ! SYM *sp;
- STORAGE sc;
-
- switch (lastst) {
- diff -w -c org/expr.c src/expr.c
- *** org/expr.c Wed Jun 15 15:50:25 1994
- --- src/expr.c Tue Jan 17 08:05:24 1995
- ***************
- *** 583,589 ****
- EXPR **node;
- TYP *tp;
- {
- ! EXPR *pnode;
- TYP *tp1;
- switch (tp->type) {
- case bt_func: /* ANSI - functions automatically dereferenced */
- --- 583,589 ----
- EXPR **node;
- TYP *tp;
- {
- ! EXPR *pnode = 0;
- TYP *tp1;
- switch (tp->type) {
- case bt_func: /* ANSI - functions automatically dereferenced */
- ***************
- *** 1143,1149 ****
- fstr = get_stringlit(ep2->v.l);
- format_position = format_start;
- } else if (fstr) {
- ! fstr = (pf->func)(fname, pnum, fstr, &format_position, tp);
- }
- }
- #endif /*FORMAT_CHECK*/
- --- 1143,1149 ----
- fstr = get_stringlit(ep2->v.l);
- format_position = format_start;
- } else if (fstr) {
- ! fstr = (*pf->func)(fname, pnum, fstr, &format_position, tp);
- }
- }
- #endif /*FORMAT_CHECK*/
- ***************
- *** 1168,1174 ****
- message(ERR_COUNTPARAM, fname);
- #ifdef FORMAT_CHECK
- else if (format_option && (fstr != 0))
- ! VOIDCAST (pf->func)(fname, pnum, fstr, &format_position, NIL_TYP);
- #endif /* FORMAT_CHECK */
- return ep1;
- }
- --- 1168,1174 ----
- message(ERR_COUNTPARAM, fname);
- #ifdef FORMAT_CHECK
- else if (format_option && (fstr != 0))
- ! VOIDCAST (*pf->func)(fname, pnum, fstr, &format_position, NIL_TYP);
- #endif /* FORMAT_CHECK */
- return ep1;
- }
- diff -w -c org/gen.h src/gen.h
- *** org/gen.h Wed Jun 15 15:50:25 1994
- --- src/gen.h Tue Jan 17 08:05:34 1995
- ***************
- *** 108,113 ****
- --- 108,116 ----
- op_slo,
- op_sls,
- op_st,
- + #ifdef TRAP_GEN
- + op_trap,
- + #endif /* TRAP_GEN */
- op_line,
- op_label
- };
- ***************
- *** 118,129 ****
- enum e_am {
- am_dreg, /* Dn */
- am_areg, /* An */
- ! am_ind, /* */
- am_ainc, /* (An)+ */
- am_adec, /* -(An) */
- am_indx, /* (d16,An) */
- ! am_indx2, /* (d8,An,Dn) */
- ! am_indx3, /* (d8,An,Am) */
- am_direct, /* (xxx) */
- am_immed, /* #(data) */
- am_smask, /* Register mask (D0 high, A7 low) */
- --- 121,135 ----
- enum e_am {
- am_dreg, /* Dn */
- am_areg, /* An */
- ! am_ind, /* (An) */
- am_ainc, /* (An)+ */
- am_adec, /* -(An) */
- am_indx, /* (d16,An) */
- ! am_indx2, /* (d8,An,Dn.l) */
- ! am_indx3, /* (d8,An,Am.l) */
- ! #ifdef JAS_PATCH
- ! am_indx4, /* (d8,An,Dn.w) */
- ! #endif /* JAS_PATCH */
- am_direct, /* (xxx) */
- am_immed, /* #(data) */
- am_smask, /* Register mask (D0 high, A7 low) */
- ***************
- *** 140,146 ****
- --- 146,156 ----
- #define FRAMEPTR 14 /* frame pointer register */
- #define STACKPTR 15 /* system stack pointer register */
-
- + #ifndef __TOS__
- #define MAX_ADDR 1 /* max. scratch address register (A1) */
- + #else
- + #define MAX_ADDR 2 /* OS-traps may destroy A2 */
- + #endif /* __TOS__ */
- #define MAX_DATA 2 /* max. scratch data register (D2) */
-
- /* support routines */
- ***************
- *** 585,611 ****
-
- #undef P_
-
- ! #define put_code(op,len,aps,apd) (Funcs->Put_code)(op,len,aps,apd)
- ! #define put_string(s) (Funcs->Put_string)(s)
- ! #define put_label(lab) (Funcs->Put_label)(lab)
- ! #define put_byte(val) (Funcs->Put_byte)(val)
- ! #define put_char(val) (Funcs->Put_char)(val)
- ! #define put_word(val) (Funcs->Put_word)(val)
- ! #define put_long(val) (Funcs->Put_long)(val)
- ! #define put_pointer(node) (Funcs->Put_pointer)(node)
- ! #define put_short(node) (Funcs->Put_short)(node)
- ! #define put_storage(sp,align) (Funcs->Put_storage)(sp,align)
- ! #define dumplits() (Funcs->Dumplits)()
- ! #define put_external(s) (Funcs->Put_external)(s)
- ! #define put_global(s) (Funcs->Put_global)(s)
- ! #define put_align(align) (Funcs->Put_align)(align)
- ! #define nl() (Funcs->Nl)()
- ! #define cseg() (Funcs->Cseg)()
- ! #define dseg() (Funcs->Dseg)()
- #ifdef FLOAT_SUPPORT
- ! #define put_float(val) (Funcs->Put_float)(val)
- ! #define put_double(val) (Funcs->Put_double)(val)
- ! #define put_longdouble(val) (Funcs->Put_longdouble)(val)
- #endif /* FLOAT_SUPPORT */
- #endif /* MULTIPLE_ASSEMBLERS */
-
- --- 595,621 ----
-
- #undef P_
-
- ! #define put_code(op,len,aps,apd) (*Funcs->Put_code)(op,len,aps,apd)
- ! #define put_string(s) (*Funcs->Put_string)(s)
- ! #define put_label(lab) (*Funcs->Put_label)(lab)
- ! #define put_byte(val) (*Funcs->Put_byte)(val)
- ! #define put_char(val) (*Funcs->Put_char)(val)
- ! #define put_word(val) (*Funcs->Put_word)(val)
- ! #define put_long(val) (*Funcs->Put_long)(val)
- ! #define put_pointer(node) (*Funcs->Put_pointer)(node)
- ! #define put_short(node) (*Funcs->Put_short)(node)
- ! #define put_storage(sp,align) (*Funcs->Put_storage)(sp,align)
- ! #define dumplits() (*Funcs->Dumplits)()
- ! #define put_external(s) (*Funcs->Put_external)(s)
- ! #define put_global(s) (*Funcs->Put_global)(s)
- ! #define put_align(align) (*Funcs->Put_align)(align)
- ! #define nl() (*Funcs->Nl)()
- ! #define cseg() (*Funcs->Cseg)()
- ! #define dseg() (*Funcs->Dseg)()
- #ifdef FLOAT_SUPPORT
- ! #define put_float(val) (*Funcs->Put_float)(val)
- ! #define put_double(val) (*Funcs->Put_double)(val)
- ! #define put_longdouble(val) (*Funcs->Put_longdouble)(val)
- #endif /* FLOAT_SUPPORT */
- #endif /* MULTIPLE_ASSEMBLERS */
-
- ***************
- *** 643,660 ****
- #endif /* MC680X0 */
- };
-
- ! #define g_expr(node,flags) (GFuncs->G_expr)(node,flags)
- ! #define g_truejp(node,label) (GFuncs->G_truejp)(node,label)
- ! #define g_falsejp(node,label) (GFuncs->G_falsejp)(node,label)
- ! #define g_stack(bytes) (GFuncs->G_stack)(bytes)
- ! #define g_switch_table(ep,sw,min,max) (GFuncs->G_switch_table)(ep,sw,min,max)
- ! #define g_switch_compare(ep,stmt) (GFuncs->G_switch_compare)(ep,stmt)
- ! #define g_entry(size) (GFuncs->G_entry)(size)
- ! #define g_return(ep,tp) (GFuncs->G_return)(ep,tp)
- ! #define g_epilogue() (GFuncs->G_epilogue)()
- ! #define allocate(csp) (GFuncs->Allocate)(csp)
- #ifdef MC680X0
- ! #define is_short(node) (GFuncs->Isshort)(node)
- #endif /* MC680X0 */
- #endif /* MULTIPLE_PROCESSORS */
-
- --- 653,670 ----
- #endif /* MC680X0 */
- };
-
- ! #define g_expr(node,flags) (*GFuncs->G_expr)(node,flags)
- ! #define g_truejp(node,label) (*GFuncs->G_truejp)(node,label)
- ! #define g_falsejp(node,label) (*GFuncs->G_falsejp)(node,label)
- ! #define g_stack(bytes) (*GFuncs->G_stack)(bytes)
- ! #define g_switch_table(ep,sw,min,max) (*GFuncs->G_switch_table)(ep,sw,min,max)
- ! #define g_switch_compare(ep,stmt) (*GFuncs->G_switch_compare)(ep,stmt)
- ! #define g_entry(size) (*GFuncs->G_entry)(size)
- ! #define g_return(ep,tp) (*GFuncs->G_return)(ep,tp)
- ! #define g_epilogue() (*GFuncs->G_epilogue)()
- ! #define allocate(csp) (*GFuncs->Allocate)(csp)
- #ifdef MC680X0
- ! #define is_short(node) (*GFuncs->Isshort)(node)
- #endif /* MC680X0 */
- #endif /* MULTIPLE_PROCESSORS */
-
- diff -w -c org/gen68k.c src/gen68k.c
- *** org/gen68k.c Wed Jun 15 15:50:26 1994
- --- src/gen68k.c Wed Jan 18 02:47:40 1995
- ***************
- *** 2442,2451 ****
- ADDRESS *ap;
- EXPR *ep0 = node->v.p[0];
- SIZE size;
- #ifdef FLOAT_IEEE
- int numregs;
- #endif /* FLOAT_IEEE */
- ! /* The stack adustment cannot be delayed if:
- * 1. The alloca() routine is called
- * 2. The function call is via a variable
- * 3. The function starts with an underscore character
- --- 2442,2452 ----
- ADDRESS *ap;
- EXPR *ep0 = node->v.p[0];
- SIZE size;
- + OPCODE op;
- #ifdef FLOAT_IEEE
- int numregs;
- #endif /* FLOAT_IEEE */
- ! /* The stack adjustment cannot be delayed if:
- * 1. The alloca() routine is called
- * 2. The function call is via a variable
- * 3. The function starts with an underscore character
- ***************
- *** 2488,2504 ****
- /* call the function */
- switch (ep0->nodetype) {
- case en_nacon:
- case en_labcon:
- ap = mk_direct(ep0);
- break;
- default:
- ap = g_expr(ep0, F_AREG);
- ap = copy_addr(ap, am_ind);
- freeop(ap);
- break;
- }
- ! g_code(op_jsr, 0, ap, NIL_ADDRESS);
- !
- #ifdef FLOAT_IEEE
- return func_result(flags, size, numregs);
- #else
- --- 2489,2530 ----
- /* call the function */
- switch (ep0->nodetype) {
- case en_nacon:
- + #ifdef TRAP_GEN
- + if (trap_option) {
- + int trap_nr = 0;
- +
- + if (!strncmp(ep0->v.sp, "_trap_1", (size_t)7))
- + switch (ep0->v.sp[7]) {
- + case '_':
- + trap_nr = 1;
- + break;
- + case '3':
- + trap_nr = 13;
- + break;
- + case '4':
- + trap_nr = 14;
- + break;
- + }
- + if (trap_nr) {
- + op = op_trap;
- + ap = mk_immed((long)trap_nr);
- + break;
- + }
- + }
- + /*FALLTHRU*/
- + #endif /* TRAP_GEN */
- case en_labcon:
- + op = op_jsr;
- ap = mk_direct(ep0);
- break;
- default:
- + op = op_jsr;
- ap = g_expr(ep0, F_AREG);
- ap = copy_addr(ap, am_ind);
- freeop(ap);
- break;
- }
- ! g_code(op, 0, ap, NIL_ADDRESS);
- #ifdef FLOAT_IEEE
- return func_result(flags, size, numregs);
- #else
- ***************
- *** 3185,3190 ****
- --- 3211,3219 ----
- call_library(SUP_FPTST);
- break;
- #endif /* FLOAT_MFFP */
- + #if !defined(FLOAT_SUPPORT) && defined(__SOZOBONX__)
- + case 0:
- + #endif
- default:
- ap = g_expr(node, F_DREG | F_MEM);
- g_code(op_tst, (int) node->esize, ap, NIL_ADDRESS);
- ***************
- *** 3362,3367 ****
- --- 3391,3397 ----
- #else
- /* jump table contains 2 byte offset of case branches */
- g_code(op_add, 4, ap, ap);
- + #ifndef JAS_PATCH
- if (IandD_option) {
- g_code(op_add, 4, ap, ap1);
- freeop(ap1);
- ***************
- *** 3376,3393 ****
- freeop(ap2);
- ap2 = copy_addr(ap2, am_ind);
- } else {
- freeop(ap1);
- ap2 = copy_addr(ap1, am_indx2);
- ap2->sreg = ap->preg;
- ap2->offset = mk_const(0l);
- g_code(op_add, 2, ap2, ap1);
- ap2 = copy_addr(ap2, am_ind);
- }
- sync_stack();
- g_code(op_jmp, 0, ap2, NIL_ADDRESS);
- if (IandD_option)
- g_label (sw->beglab);
- ! #endif
- freeop(ap);
- }
-
- --- 3406,3438 ----
- freeop(ap2);
- ap2 = copy_addr(ap2, am_ind);
- } else {
- + #endif /* JAS_PATCH */
- freeop(ap1);
- ap2 = copy_addr(ap1, am_indx2);
- ap2->sreg = ap->preg;
- ap2->offset = mk_const(0l);
- + #ifdef JAS_PATCH
- + g_code(op_lea, 0, ap2, ap1);
- + #else
- g_code(op_add, 2, ap2, ap1);
- + #endif /* JAS_PATCH */
- ap2 = copy_addr(ap2, am_ind);
- + #ifndef JAS_PATCH
- }
- + #endif /* JAS_PATCH */
- sync_stack();
- + #ifdef JAS_PATCH
- + g_code(op_move, 2, ap2, ap);
- + ap2 = copy_addr(ap1, am_indx4);
- + ap2->sreg = ap->preg;
- + ap2->offset = mk_const(0l);
- + #endif /* JAS_PATCH */
- g_code(op_jmp, 0, ap2, NIL_ADDRESS);
- + #ifndef JAS_PATCH
- if (IandD_option)
- g_label (sw->beglab);
- ! #endif /* JAS_PATCH */
- ! #endif /* RELOC_BUG */
- freeop(ap);
- }
-
- diff -w -c org/genstmt.c src/genstmt.c
- *** org/genstmt.c Wed Jun 15 15:50:27 1994
- --- src/genstmt.c Tue Jan 17 08:05:58 1995
- ***************
- *** 48,56 ****
- static void genreturn P_((STMT *stmt));
- static void genstmt P_((STMT *stmt));
-
- - #undef P_
- -
- -
-
- static void
- genwhile(stmt)
- --- 48,53 ----
- diff -w -c org/genutil.c src/genutil.c
- *** org/genutil.c Wed Jun 15 15:50:27 1994
- --- src/genutil.c Tue Jan 17 08:06:06 1995
- ***************
- *** 333,341 ****
- case en_add:
- case en_sub:
- return tst_const(node->v.p[0]) && tst_const( node->v.p[1]);
- - #ifndef RELOC_BUG
- - case en_cast:
- - #endif
- case en_uminus:
- return tst_const(node->v.p[0]);
- }
- --- 333,338 ----
- diff -w -c org/getsym.c src/getsym.c
- *** org/getsym.c Wed Jun 15 15:50:27 1994
- --- src/getsym.c Sat Jan 21 14:58:20 1995
- ***************
- *** 36,48 ****
- #define P_(s) ()
- #endif
-
- /* getsym.c */
- static int key P_((char *));
- static char *insert P_((char *, TOKEN));
- static char *found P_((char *));
- - static int isidch P_((int));
- static int is_octal_digit P_((int));
- - static int is_hex_digit P_((int));
- static int getline P_((void));
- static int getsch P_((int));
- static int radix36 P_((int));
- --- 36,54 ----
- #define P_(s) ()
- #endif
-
- + #ifdef __MINT__
- + #define is_hex_digit isxdigit
- + #define isidch iscym
- + #else
- + static int isidch P_((int));
- + static int is_hex_digit P_((int));
- + #endif /* __MINT__ */
- +
- /* getsym.c */
- static int key P_((char *));
- static char *insert P_((char *, TOKEN));
- static char *found P_((char *));
- static int is_octal_digit P_((int));
- static int getline P_((void));
- static int getsch P_((int));
- static int radix36 P_((int));
- ***************
- *** 74,80 ****
-
- static BOOL overflow;
- static WPTR hash[MAXKEY];
- ! static char linein[500];
- static char *lptr,*sptr;
- static int lineno;
- static size_t max_string;
- --- 80,86 ----
-
- static BOOL overflow;
- static WPTR hash[MAXKEY];
- ! static char linein[1024];
- static char *lptr,*sptr;
- static int lineno;
- static size_t max_string;
- ***************
- *** 82,92 ****
- /* calculate the key for the hash function */
- static int
- key(p)
- ! char *p;
- {
- ! int sum;
- for (sum=0; *p; )
- ! sum += *p++;
- return (sum % MAXKEY);
- }
-
- --- 88,98 ----
- /* calculate the key for the hash function */
- static int
- key(p)
- ! register char *p;
- {
- ! register unsigned int sum;
- for (sum=0; *p; )
- ! sum += (sum << 5) + *p++;
- return (sum % MAXKEY);
- }
-
- ***************
- *** 153,159 ****
- isidch(c)
- int c;
- {
- ! return isalnum(c) || c == '_' || c == '$';
- }
-
- #endif
- --- 159,165 ----
- isidch(c)
- int c;
- {
- ! return isalnum(c) || c == '_' /* || c == '$' */;
- }
-
- #endif
- ***************
- *** 191,196 ****
- --- 197,203 ----
- return (c>= '0' && c <= '7');
- }
-
- + #ifndef is_hex_digit
- static int
- is_hex_digit(c)
- int c;
- ***************
- *** 203,208 ****
- --- 210,216 ----
- (c>= 'A' && c<='F'));
- }
-
- + #endif
-
- void
- initsym()
- diff -w -c org/msgout.c src/msgout.c
- *** org/msgout.c Wed Jun 15 15:50:28 1994
- --- src/msgout.c Tue Jan 17 08:06:26 1995
- ***************
- *** 52,64 ****
- # define P3(p1, p2, p3, p4, p5, p6) (p1 p2, p3 p4, p5 p6, ...)
- # else
- # define P1(p1, p2) (p2) p1 p2;
- ! # define P2(p1, p2, p3, p4, p5, p6) (p2, p4, p6) p1 p2; p3 p4; p5 p6
- # endif
- #else
- # include <varargs.h>
- # define VA_START(a,s) va_start(a)
- # define P1(p1, p2) (p2, va_alist) p1 p2; va_dcl
- ! # define P2(p1, p2, p3, p4) (p2, p4, va_alist) p1 p2; p3 p4; va_dcl
- #endif
-
- #ifdef HAS_NLS
- --- 52,64 ----
- # define P3(p1, p2, p3, p4, p5, p6) (p1 p2, p3 p4, p5 p6, ...)
- # else
- # define P1(p1, p2) (p2) p1 p2;
- ! # define P3(p1, p2, p3, p4, p5, p6) (p2, p4, p6) p1 p2; p3 p4; p5 p6
- # endif
- #else
- # include <varargs.h>
- # define VA_START(a,s) va_start(a)
- # define P1(p1, p2) (p2, va_alist) p1 p2; va_dcl
- ! # define P3(p1, p2, p3, p4) (p2, p4, va_alist) p1 p2; p3 p4; va_dcl
- #endif
-
- #ifdef HAS_NLS
- ***************
- *** 206,212 ****
- */
- /* WARN_AUTOINIT */ "auto initialisation not reached",
- /* WARN_NOHEX */ "\\x not followed by any hex characters",
- - /* WARN_PARAMSIZE */ "size of parameter %d changed by prototype on function %s",
- /* WARN_REDEFINE */ "redefinition of '%s'",
- /* WARN_SIZEOF0 */ "'sizeof' value is zero",
- /* WARN_SIZEOFBIG */ "'sizeof' value %ld is greater than '65535'",
- --- 206,211 ----
- ***************
- *** 240,245 ****
- --- 239,245 ----
- /* WARN_IMPLICIT */ "argument '%s' implicitly declared 'int'",
- /* WARN_NOTKANDR */ "the use of '%s' is not allowed under strict K&R C",
- /* WARN_NOTREACHED */ "statement not reached",
- + /* WARN_PARAMSIZE */ "size of parameter %d changed by prototype on function %s",
- /* WARN_PROTOTYPE */ "K&R style function %s",
- /* WARN_PROMOTE */ "parameter %d to function %s() promoted to '%s'",
- /* WARN_STORAGE */ "storage specifier not at start of definition",
- ***************
- *** 284,290 ****
- /*
- * Miscellaneous messages
- */
- ! /* MSG_DEFAULTS */ "\n\nDefault settings are:-\n",
- /* MSG_ERROR */ "error",
- /* MSG_ERRORCNT */ "\n -- %d errors found",
- /* MSG_EXTRAPARAM */ "too many parameters supplied",
- --- 284,290 ----
- /*
- * Miscellaneous messages
- */
- ! /* MSG_DEFAULTS */ "\n\nDefault settings are:\n",
- /* MSG_ERROR */ "error",
- /* MSG_ERRORCNT */ "\n -- %d errors found",
- /* MSG_EXTRAPARAM */ "too many parameters supplied",
- diff -w -c org/optimize.c src/optimize.c
- *** org/optimize.c Wed Jun 15 15:50:28 1994
- --- src/optimize.c Tue Jan 17 08:06:34 1995
- ***************
- *** 318,329 ****
- /*
- * return which power of two i is or -1.
- */
- ! long i;
- {
- ! int p;
- ! long q;
- ! q = 2;
- ! p = 1;
- while (q > 0) {
- if (q == i)
- return p;
- --- 318,328 ----
- /*
- * return which power of two i is or -1.
- */
- ! register long i;
- {
- ! register int p = 1;
- ! register long q = 2;
- !
- while (q > 0) {
- if (q == i)
- return p;
- diff -w -c org/out68k_ack.c src/out68k_ack.c
- *** org/out68k_ack.c Wed Jun 15 15:50:28 1994
- --- src/out68k_ack.c Tue Jan 17 08:06:42 1995
- ***************
- *** 170,175 ****
- --- 170,178 ----
- "scs", /* op_slo */
- "sls", /* op_sls */
- "st", /* op_st */
- + #ifdef TRAP_GEN
- + "trap", /* op_trap */
- + #endif /* TRAP_GEN */
- ".line", /* op_line */
- 0, /* op_label */
- };
- ***************
- *** 653,659 ****
- VOIDCAST time (&time_of_day);
- #endif /* VERBOSE */
- init_done++;
- ! oprintf("%s Generated by %s %s %s (%s) from \"%s\"\n",
- comment, PROGNAME, VERSION, LAST_CHANGE_DATE, __DATE__, act_file);
- #ifdef VERBOSE
- oprintf("%s Compilation date/time: %s\n", comment, ctime(&time_of_day));
- --- 656,662 ----
- VOIDCAST time (&time_of_day);
- #endif /* VERBOSE */
- init_done++;
- ! oprintf("%s Generated by %s v%s, %s (%s) from \"%s\"\n",
- comment, PROGNAME, VERSION, LAST_CHANGE_DATE, __DATE__, act_file);
- #ifdef VERBOSE
- oprintf("%s Compilation date/time: %s\n", comment, ctime(&time_of_day));
- diff -w -c org/out68k_cpm.c src/out68k_cpm.c
- *** org/out68k_cpm.c Wed Jun 15 15:50:29 1994
- --- src/out68k_cpm.c Tue Jan 17 08:06:50 1995
- ***************
- *** 170,175 ****
- --- 170,178 ----
- "scs", /* op_slo */
- "sls", /* op_sls */
- "st", /* op_st */
- + #ifdef TRAP_GEN
- + "trap", /* op_trap */
- + #endif /* TRAP_GEN */
- "*.line", /* op_line */
- 0, /* op_label */
- };
- ***************
- *** 451,457 ****
- int val;
- {
- put_header(wordgen, (SIZE)AL_SHORT);
- ! oprintf(",%d", val & 0xffff);
- outcol += 6;
- }
-
- --- 454,460 ----
- int val;
- {
- put_header(wordgen, (SIZE)AL_SHORT);
- ! oprintf("%d", val & 0xffff);
- outcol += 6;
- }
-
- ***************
- *** 568,573 ****
- --- 571,577 ----
- else
- cseg();
- for ( ; strtab != 0; strtab = strtab->next) {
- + nl();
- put_label(strtab->label);
- cp = strtab->str;
- for (len = strtab->len; len--; )
- ***************
- *** 619,628 ****
- {
- static BOOL init_done = 0;
- if (init_done == 0) {
- time_t time_of_day;
- VOIDCAST time (&time_of_day);
- init_done++;
- ! oprintf("%s Generated by %s %s %s (%s) from \"%s\"\n",
- comment, PROGNAME, VERSION, LAST_CHANGE_DATE, __DATE__, act_file);
- #ifdef VERBOSE
- oprintf("%s Compilation date/time: %s\n", comment, ctime(&time_of_day));
- --- 623,634 ----
- {
- static BOOL init_done = 0;
- if (init_done == 0) {
- + #ifdef VERBOSE
- time_t time_of_day;
- VOIDCAST time (&time_of_day);
- + #endif /* VERBOSE */
- init_done++;
- ! oprintf("%s Generated by %s v%s, %s (%s) from \"%s\"\n",
- comment, PROGNAME, VERSION, LAST_CHANGE_DATE, __DATE__, act_file);
- #ifdef VERBOSE
- oprintf("%s Compilation date/time: %s\n", comment, ctime(&time_of_day));
- ***************
- *** 641,647 ****
- {
- nl();
- if (curseg != segtype) {
- ! oprintf("\t.sect\t%s\n", segname);
- curseg = segtype;
- align_type = 0;
- }
- --- 647,653 ----
- {
- nl();
- if (curseg != segtype) {
- ! oprintf("\t%s\n", segname);
- curseg = segtype;
- align_type = 0;
- }
- diff -w -c org/out68k_gas.c src/out68k_gas.c
- *** org/out68k_gas.c Wed Jun 15 15:50:29 1994
- --- src/out68k_gas.c Tue Jan 17 08:06:58 1995
- ***************
- *** 171,176 ****
- --- 171,179 ----
- "scs", /* op_slo */
- "sls", /* op_sls */
- "st", /* op_st */
- + #ifdef TRAP_GEN
- + "trap", /* op_trap */
- + #endif /* TRAP_GEN */
- "#.line", /* op_line */
- 0, /* op_label */
- };
- ***************
- *** 452,458 ****
- int val;
- {
- put_header (wordgen, (SIZE)AL_SHORT);
- ! oprintf(",%d", val & 0xffffff);
- outcol += 6;
- }
-
- --- 455,461 ----
- int val;
- {
- put_header (wordgen, (SIZE)AL_SHORT);
- ! oprintf("%d", val & 0xffffff);
- outcol += 6;
- }
-
- ***************
- *** 572,577 ****
- --- 575,581 ----
- else
- cseg();
- for ( ; strtab != 0; strtab = strtab->next) {
- + nl();
- put_label(strtab->label);
- cp = strtab->str;
- for (len = strtab->len; len--; )
- ***************
- *** 622,631 ****
- {
- static BOOL init_done = 0;
- if (init_done == 0) {
- time_t time_of_day;
- VOIDCAST time (&time_of_day);
- init_done++;
- ! oprintf("%s Generated by %s %s %s (%s) from \"%s\"\n",
- comment, PROGNAME, VERSION, LAST_CHANGE_DATE, __DATE__, act_file);
- #ifdef VERBOSE
- oprintf("%s Compilation date/time: %s\n", comment, ctime(&time_of_day));
- --- 626,637 ----
- {
- static BOOL init_done = 0;
- if (init_done == 0) {
- + #ifdef VERBOSE
- time_t time_of_day;
- VOIDCAST time (&time_of_day);
- + #endif /* VERBOSE */
- init_done++;
- ! oprintf("%s Generated by %s v%s, %s (%s) from \"%s\"\n",
- comment, PROGNAME, VERSION, LAST_CHANGE_DATE, __DATE__, act_file);
- #ifdef VERBOSE
- oprintf("%s Compilation date/time: %s\n", comment, ctime(&time_of_day));
- diff -w -c org/out68k_qmc.c src/out68k_qmc.c
- *** org/out68k_qmc.c Wed Jun 15 15:50:30 1994
- --- src/out68k_qmc.c Tue Jan 17 08:07:08 1995
- ***************
- *** 162,167 ****
- --- 162,170 ----
- "SCS", /* op_slo */
- "SLS", /* op_sls */
- "ST", /* op_st */
- + #ifdef TRAP_GEN
- + "TRAP", /* op_trap */
- + #endif /* TRAP_GEN */
- "COMMENT", /* op_line */
- 0, /* op_label */
- };
- ***************
- *** 640,646 ****
- time_t time_of_day;
- VOIDCAST time (&time_of_day);
- init_done++;
- ! oprintf("%s Generated by %s %s %s (%s) from \"%s\"\n",
- comment, PROGNAME, VERSION, LAST_CHANGE_DATE, __DATE__, act_file);
- #ifdef VERBOSE
- oprintf("%s Compilation date/time: %s\n", comment, ctime(&time_of_day));
- --- 643,649 ----
- time_t time_of_day;
- VOIDCAST time (&time_of_day);
- init_done++;
- ! oprintf("%s Generated by %s v%s, %s (%s) from \"%s\"\n",
- comment, PROGNAME, VERSION, LAST_CHANGE_DATE, __DATE__, act_file);
- #ifdef VERBOSE
- oprintf("%s Compilation date/time: %s\n", comment, ctime(&time_of_day));
- diff -w -c org/peep68k.c src/peep68k.c
- *** org/peep68k.c Wed Jun 15 15:50:29 1994
- --- src/peep68k.c Tue Jan 17 08:07:18 1995
- ***************
- *** 427,435 ****
- --- 427,437 ----
- peep_head = 0;
- for(sw=swtables; sw; sw=sw->next) {
- nl();
- + #ifndef JAS_PATCH
- if (IandD_option)
- dseg();
- else
- + #endif /* JAS_PATCH */
- cseg();
- put_align((SIZE)AL_POINTER);
- put_label(sw->tablab);
- ***************
- *** 442,451 ****
- }
- #else
- /* generate the switch jump table as a series of 2-byte offsets
- ! * This limits the amount of code the can be generated in a
- * function to less then 32K. I believe that this is a reasonable
- * restriction.
- */
- {
- EXPR *ep, *ep1;
- ep1 = mk_lcon(sw->beglab);
- --- 444,459 ----
- }
- #else
- /* generate the switch jump table as a series of 2-byte offsets
- ! * This limits the amount of code that can be generated in a
- * function to less then 32K. I believe that this is a reasonable
- * restriction.
- */
- + #ifdef JAS_PATCH
- + for(i=0; i<sw->numlabs; i++) {
- + ep2->v.l = sw->labels[i];
- + put_short(ep2);
- + }
- + #else
- {
- EXPR *ep, *ep1;
- ep1 = mk_lcon(sw->beglab);
- ***************
- *** 455,460 ****
- --- 463,469 ----
- put_short(ep);
- }
- }
- + #endif /* JAS_PATCH */
- #endif /* RELOC_BUG */
- }
- swtables = NULL;
- diff -w -c org/symbol.c src/symbol.c
- *** org/symbol.c Wed Jun 15 15:50:30 1994
- --- src/symbol.c Tue Jan 17 08:07:26 1995
- ***************
- *** 112,120 ****
- key(p)
- register char *p;
- {
- ! register int sum;
- for (sum=0; *p; )
- ! sum += *p++;
- return (sum % MAXKEY);
- }
-
- --- 112,120 ----
- key(p)
- register char *p;
- {
- ! register unsigned int sum;
- for (sum=0; *p; )
- ! sum += (sum << 5) + *p++;
- return (sum % MAXKEY);
- }
-
- ***************
- *** 482,488 ****
- endparamblock()
- {
- SYM *sp;
- ! BLOCK *block = scope.local;;
- for (sp = block->symbols.head; sp != NULL; sp = sp->next) {
- deletesym(sp, symbols);
- }
- --- 482,488 ----
- endparamblock()
- {
- SYM *sp;
- ! BLOCK *block = scope.local;
- for (sp = block->symbols.head; sp != NULL; sp = sp->next) {
- deletesym(sp, symbols);
- }
- diff -w -c org/version.h src/version.h
- *** org/version.h Wed Jun 15 15:50:30 1994
- --- src/version.h Fri Jan 27 23:51:28 1995
- ***************
- *** 1,3 ****
- ! #define VERSION "4.4"
- ! #define LAST_CHANGE_DATE "10 May 94"
- !
- --- 1,2 ----
- ! #define VERSION "4.4.5"
- ! #define LAST_CHANGE_DATE "25 Jan 95"
-